<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Client-side GObject bindings</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="ch29.html" title="Migrating to GDBus">
<link rel="prev" href="ch29s04.html" title="Creating proxies for well-known names">
<link rel="next" href="ch29s06.html" title="Exporting objects">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="ch29s04.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch29.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="ch29s06.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id492882"></a>Client-side GObject bindings</h2></div></div></div>
<p>
      dbus-glib comes with <span class="command"><strong>dbus-binding-tool</strong></span>, which
      can produce somewhat nice client-side wrappers for a D-Bus interface.
      GDBus does not have code-generation at this point, but <a class="link" href="GDBusProxy.html" title="GDBusProxy"><span class="type">GDBusProxy</span></a>
      is designed to allow the creating of client-side wrappers by
      subclassing <a class="link" href="GDBusProxy.html" title="GDBusProxy"><span class="type">GDBusProxy</span></a>.
    </p>
<p>
      For an example of a <span class="type">GDBusProxy-derived</span> class that wraps a D-Bus
      interface in a type-safe way, see <a class="xref" href="ch29s05.html#gdbus-example-proxy-subclass" title="Example 19. GDBusProxy subclass example">Example 19, “GDBusProxy subclass example”</a>. The comparison is as
      follows:
      </p>
<div class="table">
<a name="gdbus-example-type-safe-proxy"></a><p class="title"><b>Table 8. Wrapping the org.freedesktop.Accounts.User D-Bus interface in the AccountUser GObject type</b></p>
<div class="table-contents"><table summary="Wrapping the org.freedesktop.Accounts.User D-Bus interface in the AccountUser GObject type" border="1">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>D-Bus concept</th>
<th>GObject concept</th>
</tr></thead>
<tbody>
<tr>
<td>AutomaticLogin property</td>
<td>
                <p><code class="literal">AccountsUser:automatic-login</code> GObject property</p>
                <p>C getter: <code class="function">accounts_user_get_automatic_login()</code></p>
                <p>Watch changes via the <code class="literal">notify::automatic-login</code> signal</p>
              </td>
</tr>
<tr>
<td>RealName property</td>
<td>
                <p><code class="literal">AccountsUser:real-name</code> GObject property</p>
                <p>C getter: <code class="function">accounts_user_get_real_name()</code></p>
                <p>Watch changes via the <code class="literal">notify::real-name signal</code></p>
              </td>
</tr>
<tr>
<td>UserName property</td>
<td>
                <p><code class="literal">AccountsUser:user-name</code> GObject property</p>
                <p>C getter: <code class="function">accounts_user_get_user_name()</code></p>
                <p>Watch changes via the <code class="literal">notify::user-name</code> signal</p>
              </td>
</tr>
<tr>
<td>Changed signal</td>
<td>
                <p><code class="literal">AccountsUser::changed</code> GObject signal</p>
                <p>Watch via e.g. <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a></p>
              </td>
</tr>
<tr>
<td>Frobnicate method</td>
<td>
                <p>Use <code class="function">accounts_user_frobnicate()</code> + <code class="function">accounts_user_frobnicate_finish()</code> or <code class="function">accounts_user_frobnicate_sync()</code> to invoke</p>
              </td>
</tr>
</tbody>
</table></div>
</div>
<p><br class="table-break">
    </p>
<div class="example">
<a name="gdbus-example-proxy-subclass"></a><p class="title"><b>Example 19. GDBusProxy subclass example</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="preproc">#include</span><span class="normal"> </span><span class="string">&lt;gio/gio.h&gt;</span>

<span class="comment">/* ---------------------------------------------------------------------------------------------------- */</span>
<span class="comment">/* The D-Bus interface definition we want to create a GDBusProxy-derived type for: */</span>
<span class="comment">/* ---------------------------------------------------------------------------------------------------- */</span>

<span class="keyword">static</span><span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> introspection_xml</span><span class="symbol">[]</span><span class="normal"> </span><span class="symbol">=</span>
<span class="normal">  </span><span class="string">"&lt;node&gt;"</span>
<span class="normal">  </span><span class="string">"  &lt;interface name='org.freedesktop.Accounts.User'&gt;"</span>
<span class="normal">  </span><span class="string">"    &lt;method name='Frobnicate'&gt;"</span>
<span class="normal">  </span><span class="string">"      &lt;arg name='flux' type='s' direction='in'/&gt;"</span>
<span class="normal">  </span><span class="string">"      &lt;arg name='baz' type='s' direction='in'/&gt;"</span>
<span class="normal">  </span><span class="string">"      &lt;arg name='result' type='s' direction='out'/&gt;"</span>
<span class="normal">  </span><span class="string">"    &lt;/method&gt;"</span>
<span class="normal">  </span><span class="string">"    &lt;signal name='Changed'/&gt;"</span>
<span class="normal">  </span><span class="string">"    &lt;property name='AutomaticLogin' type='b' access='readwrite'/&gt;"</span>
<span class="normal">  </span><span class="string">"    &lt;property name='RealName' type='s' access='read'/&gt;"</span>
<span class="normal">  </span><span class="string">"    &lt;property name='UserName' type='s' access='read'/&gt;"</span>
<span class="normal">  </span><span class="string">"  &lt;/interface&gt;"</span>
<span class="normal">  </span><span class="string">"&lt;/node&gt;"</span><span class="symbol">;</span>

<span class="comment">/* ---------------------------------------------------------------------------------------------------- */</span>
<span class="comment">/* Definition of the AccountsUser type */</span>
<span class="comment">/* ---------------------------------------------------------------------------------------------------- */</span>

<span class="preproc">#define</span><span class="normal"> </span><span class="function">ACCOUNTS_TYPE_USER</span><span class="normal">         </span><span class="symbol">(</span><span class="function">accounts_user_get_type</span><span class="normal"> </span><span class="symbol">())</span>
<span class="preproc">#define</span><span class="normal"> </span><span class="function">ACCOUNTS_USER</span><span class="symbol">(</span><span class="normal">o</span><span class="symbol">)</span><span class="normal">           </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE-CAST:CAPS">G_TYPE_CHECK_INSTANCE_CAST</a></span><span class="normal"> </span><span class="symbol">((</span><span class="normal">o</span><span class="symbol">),</span><span class="normal"> ACCOUNTS_TYPE_USER</span><span class="symbol">,</span><span class="normal"> AccountsUser</span><span class="symbol">))</span>
<span class="preproc">#define</span><span class="normal"> </span><span class="function">ACCOUNTS_USER_CLASS</span><span class="symbol">(</span><span class="normal">k</span><span class="symbol">)</span><span class="normal">     </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-CHECK-CLASS-CAST:CAPS">G_TYPE_CHECK_CLASS_CAST</a></span><span class="symbol">((</span><span class="normal">k</span><span class="symbol">),</span><span class="normal"> ACCOUNTS_TYPE_USER</span><span class="symbol">,</span><span class="normal"> AccountsUserClass</span><span class="symbol">))</span>
<span class="preproc">#define</span><span class="normal"> </span><span class="function">ACCOUNTS_USER_GET_CLASS</span><span class="symbol">(</span><span class="normal">o</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-INSTANCE-GET-CLASS:CAPS">G_TYPE_INSTANCE_GET_CLASS</a></span><span class="normal"> </span><span class="symbol">((</span><span class="normal">o</span><span class="symbol">),</span><span class="normal"> ACCOUNTS_TYPE_USER</span><span class="symbol">,</span><span class="normal"> AccountsUserClass</span><span class="symbol">))</span>
<span class="preproc">#define</span><span class="normal"> </span><span class="function">ACCOUNTS_IS_USER</span><span class="symbol">(</span><span class="normal">o</span><span class="symbol">)</span><span class="normal">        </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-CHECK-INSTANCE-TYPE:CAPS">G_TYPE_CHECK_INSTANCE_TYPE</a></span><span class="normal"> </span><span class="symbol">((</span><span class="normal">o</span><span class="symbol">),</span><span class="normal"> ACCOUNTS_TYPE_USER</span><span class="symbol">))</span>
<span class="preproc">#define</span><span class="normal"> </span><span class="function">ACCOUNTS_IS_USER_CLASS</span><span class="symbol">(</span><span class="normal">k</span><span class="symbol">)</span><span class="normal">  </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-CHECK-CLASS-TYPE:CAPS">G_TYPE_CHECK_CLASS_TYPE</a></span><span class="normal"> </span><span class="symbol">((</span><span class="normal">k</span><span class="symbol">),</span><span class="normal"> ACCOUNTS_TYPE_USER</span><span class="symbol">))</span>

<span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="classname">_AccountsUser</span><span class="normal">        AccountsUser</span><span class="symbol">;</span>
<span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="classname">_AccountsUserClass</span><span class="normal">   AccountsUserClass</span><span class="symbol">;</span>
<span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="classname">_AccountsUserPrivate</span><span class="normal"> AccountsUserPrivate</span><span class="symbol">;</span>

<span class="keyword">struct</span><span class="normal"> </span><span class="classname">_AccountsUser</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="comment">/*&lt; private &gt;*/</span>
<span class="normal">  </span><span class="usertype">GDBusProxy</span><span class="normal"> parent_instance</span><span class="symbol">;</span>
<span class="normal">  </span><span class="usertype">AccountsUserPrivate</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">priv</span><span class="symbol">;</span>
<span class="cbracket">}</span><span class="symbol">;</span>

<span class="keyword">struct</span><span class="normal"> </span><span class="classname">_AccountsUserClass</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="comment">/*&lt; private &gt;*/</span>
<span class="normal">  </span><span class="usertype">GDBusProxyClass</span><span class="normal"> parent_class</span><span class="symbol">;</span>
<span class="normal">  </span><span class="type">void</span><span class="normal"> </span><span class="symbol">(*</span><span class="normal"><a href="/usr/share/gtk-doc/html/UPower/UPower-up-device.html#changed">changed</a></span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">);</span>
<span class="cbracket">}</span><span class="symbol">;</span>

<span class="usertype">GType</span><span class="normal">        </span><span class="function">accounts_user_get_type</span><span class="normal">            </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Miscellaneous-Macros.html#G-GNUC-CONST:CAPS">G_GNUC_CONST</a></span><span class="symbol">;</span>

<span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="function">accounts_user_get_user_name</span><span class="normal">       </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">);</span>
<span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="function">accounts_user_get_real_name</span><span class="normal">       </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">);</span>
<span class="usertype">gboolean</span><span class="normal">     </span><span class="function">accounts_user_get_automatic_login</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">);</span>

<span class="type">void</span><span class="normal">         </span><span class="function">accounts_user_frobnicate</span><span class="normal">          </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal">         </span><span class="symbol">*</span><span class="normal">flux</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">gint</span><span class="normal">                 baz</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">GCancellable</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">cancellable</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">GAsyncReadyCallback</span><span class="normal">  callback</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">gpointer</span><span class="normal">             user_data</span><span class="symbol">);</span>
<span class="usertype">gchar</span><span class="normal">       </span><span class="symbol">*</span><span class="function">accounts_user_frobnicate_finish</span><span class="normal">   </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">GAsyncResult</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">res</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">GError</span><span class="normal">             </span><span class="symbol">**</span><span class="normal">error</span><span class="symbol">);</span>
<span class="usertype">gchar</span><span class="normal">       </span><span class="symbol">*</span><span class="function">accounts_user_frobnicate_sync</span><span class="normal">     </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal">         </span><span class="symbol">*</span><span class="normal">flux</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">gint</span><span class="normal">                 baz</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">GCancellable</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">cancellable</span><span class="symbol">,</span>
<span class="normal">                                                </span><span class="usertype">GError</span><span class="normal">             </span><span class="symbol">**</span><span class="normal">error</span><span class="symbol">);</span>

<span class="comment">/* ---------------------------------------------------------------------------------------------------- */</span>
<span class="comment">/* Implementation of the AccountsUser type */</span>
<span class="comment">/* ---------------------------------------------------------------------------------------------------- */</span>

<span class="comment">/* A more efficient approach than parsing XML is to use const static</span>
<span class="comment"> * GDBusInterfaceInfo, GDBusMethodInfo, ... structures</span>
<span class="comment"> */</span>
<span class="keyword">static</span><span class="normal"> <a href="gio-D-Bus-Introspection-Data.html#GDBusInterfaceInfo">GDBusInterfaceInfo</a> </span><span class="symbol">*</span>
<span class="function">accounts_user_get_interface_info</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="keyword">static</span><span class="normal"> </span><span class="usertype">gsize</span><span class="normal"> has_info </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
<span class="normal">  </span><span class="keyword">static</span><span class="normal"> </span><span class="usertype">GDBusInterfaceInfo</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">info </span><span class="symbol">=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
<span class="normal">  </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Threads.html#g-once-init-enter">g_once_init_enter</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">has_info</span><span class="symbol">))</span>
<span class="normal">    </span><span class="cbracket">{</span>
<span class="normal">      </span><span class="usertype">GDBusNodeInfo</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">introspection_data</span><span class="symbol">;</span>
<span class="normal">      introspection_data </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gio-D-Bus-Introspection-Data.html#g-dbus-node-info-new-for-xml">g_dbus_node_info_new_for_xml</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">introspection_xml</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">      info </span><span class="symbol">=</span><span class="normal"> introspection_data</span><span class="symbol">-&gt;</span><span class="normal">interfaces</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">];</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Threads.html#g-once-init-leave">g_once_init_leave</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">has_info</span><span class="symbol">,</span><span class="normal"> </span><span class="number">1</span><span class="symbol">);</span>
<span class="normal">    </span><span class="cbracket">}</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> info</span><span class="symbol">;</span>
<span class="cbracket">}</span>

<span class="keyword">enum</span>
<span class="cbracket">{</span>
<span class="normal">  PROP_0</span><span class="symbol">,</span>
<span class="normal">  PROP_USER_NAME</span><span class="symbol">,</span>
<span class="normal">  PROP_REAL_NAME</span><span class="symbol">,</span>
<span class="normal">  PROP_AUTOMATIC_LOGIN</span><span class="symbol">,</span>
<span class="cbracket">}</span><span class="symbol">;</span>

<span class="keyword">enum</span>
<span class="cbracket">{</span>
<span class="normal">  CHANGED_SIGNAL</span><span class="symbol">,</span>
<span class="normal">  LAST_SIGNAL</span>
<span class="cbracket">}</span><span class="symbol">;</span>

<span class="keyword">static</span><span class="normal"> </span><span class="usertype">guint</span><span class="normal"> signals</span><span class="symbol">[</span><span class="normal">LAST_SIGNAL</span><span class="symbol">]</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> </span><span class="cbracket">{</span><span class="number">0</span><span class="cbracket">}</span><span class="symbol">;</span>

<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-DEFINE-TYPE:CAPS">G_DEFINE_TYPE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">AccountsUser</span><span class="symbol">,</span><span class="normal"> accounts_user</span><span class="symbol">,</span><span class="normal"> G_TYPE_DBUS_PROXY</span><span class="symbol">);</span>

<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">accounts_user_finalize</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GObject</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">object</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">G_GNUC_UNUSED</span><span class="normal"> </span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user </span><span class="symbol">=</span><span class="normal"> </span><span class="function">ACCOUNTS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">object</span><span class="symbol">);</span>

<span class="normal">  </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#G-OBJECT-CLASS:CAPS">G_OBJECT_CLASS</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">accounts_user_parent_class</span><span class="symbol">)-&gt;</span><span class="normal">finalize </span><span class="symbol">!=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span>
<span class="normal">    </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#G-OBJECT-CLASS:CAPS">G_OBJECT_CLASS</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">accounts_user_parent_class</span><span class="symbol">)-&gt;</span><span class="function">finalize</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">object</span><span class="symbol">);</span>
<span class="cbracket">}</span>

<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">accounts_user_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="comment">/* Sets the expected interface */</span>
<span class="normal">  </span><span class="function"><a href="GDBusProxy.html#g-dbus-proxy-set-interface-info">g_dbus_proxy_set_interface_info</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">G_DBUS_PROXY</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> </span><span class="function">accounts_user_get_interface_info</span><span class="normal"> </span><span class="symbol">());</span>
<span class="cbracket">}</span>

<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">accounts_user_get_property</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GObject</span><span class="normal">    </span><span class="symbol">*</span><span class="normal">object</span><span class="symbol">,</span>
<span class="normal">                            </span><span class="usertype">guint</span><span class="normal">       prop_id</span><span class="symbol">,</span>
<span class="normal">                            </span><span class="usertype">GValue</span><span class="normal">     </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">,</span>
<span class="normal">                            </span><span class="usertype">GParamSpec</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">pspec</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user </span><span class="symbol">=</span><span class="normal"> </span><span class="function">ACCOUNTS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">object</span><span class="symbol">);</span>

<span class="normal">  </span><span class="keyword">switch</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">prop_id</span><span class="symbol">)</span>
<span class="normal">    </span><span class="cbracket">{</span>
<span class="normal">    </span><span class="keyword">case</span><span class="normal"> PROP_USER_NAME</span><span class="symbol">:</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-value-set-string">g_value_set_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">,</span><span class="normal"> </span><span class="function">accounts_user_get_user_name</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">));</span>
<span class="normal">      </span><span class="keyword">break</span><span class="symbol">;</span>

<span class="normal">    </span><span class="keyword">case</span><span class="normal"> PROP_REAL_NAME</span><span class="symbol">:</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-value-set-string">g_value_set_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">,</span><span class="normal"> </span><span class="function">accounts_user_get_real_name</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">));</span>
<span class="normal">      </span><span class="keyword">break</span><span class="symbol">;</span>

<span class="normal">    </span><span class="keyword">case</span><span class="normal"> PROP_AUTOMATIC_LOGIN</span><span class="symbol">:</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-value-set-boolean">g_value_set_boolean</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">,</span><span class="normal"> </span><span class="function">accounts_user_get_automatic_login</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">));</span>
<span class="normal">      </span><span class="keyword">break</span><span class="symbol">;</span>

<span class="label">    default:</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#G-OBJECT-WARN-INVALID-PROPERTY-ID:CAPS">G_OBJECT_WARN_INVALID_PROPERTY_ID</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">object</span><span class="symbol">,</span><span class="normal"> prop_id</span><span class="symbol">,</span><span class="normal"> pspec</span><span class="symbol">);</span>
<span class="normal">      </span><span class="keyword">break</span><span class="symbol">;</span>
<span class="normal">    </span><span class="cbracket">}</span>
<span class="cbracket">}</span>

<span class="keyword">const</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar">gchar</a> </span><span class="symbol">*</span>
<span class="function">accounts_user_get_user_name</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>
<span class="normal">  </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">ret</span><span class="symbol">;</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">ACCOUNTS_IS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">  value </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDBusProxy.html#g-dbus-proxy-get-cached-property">g_dbus_proxy_get_cached_property</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">G_DBUS_PROXY</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"UserName"</span><span class="symbol">);</span>
<span class="normal">  ret </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string">g_variant_get_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-unref">g_variant_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> ret</span><span class="symbol">;</span>
<span class="cbracket">}</span>

<span class="keyword">const</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar">gchar</a> </span><span class="symbol">*</span>
<span class="function">accounts_user_get_real_name</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>
<span class="normal">  </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">ret</span><span class="symbol">;</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">ACCOUNTS_IS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">  value </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDBusProxy.html#g-dbus-proxy-get-cached-property">g_dbus_proxy_get_cached_property</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">G_DBUS_PROXY</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"RealName"</span><span class="symbol">);</span>
<span class="normal">  ret </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string">g_variant_get_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-unref">g_variant_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> ret</span><span class="symbol">;</span>
<span class="cbracket">}</span>

<span class="normal"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean">gboolean</a></span>
<span class="function">accounts_user_get_automatic_login</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>
<span class="normal">  </span><span class="usertype">gboolean</span><span class="normal"> ret</span><span class="symbol">;</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">ACCOUNTS_IS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS">FALSE</a></span><span class="symbol">);</span>
<span class="normal">  value </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDBusProxy.html#g-dbus-proxy-get-cached-property">g_dbus_proxy_get_cached_property</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">G_DBUS_PROXY</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"AutomaticLogin"</span><span class="symbol">);</span>
<span class="normal">  ret </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-boolean">g_variant_get_boolean</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-unref">g_variant_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> ret</span><span class="symbol">;</span>
<span class="cbracket">}</span>

<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">accounts_user_g_signal</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GDBusProxy</span><span class="normal">   </span><span class="symbol">*</span><span class="normal">proxy</span><span class="symbol">,</span>
<span class="normal">                        </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal">  </span><span class="symbol">*</span><span class="normal">sender_name</span><span class="symbol">,</span>
<span class="normal">                        </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal">  </span><span class="symbol">*</span><span class="normal">signal_name</span><span class="symbol">,</span>
<span class="normal">                        </span><span class="usertype">GVariant</span><span class="normal">     </span><span class="symbol">*</span><span class="normal">parameters</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user </span><span class="symbol">=</span><span class="normal"> </span><span class="function">ACCOUNTS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">proxy</span><span class="symbol">);</span>
<span class="normal">  </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strcmp0">g_strcmp0</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">signal_name</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Changed"</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> </span><span class="number">0</span><span class="symbol">)</span>
<span class="normal">    </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-emit">g_signal_emit</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">,</span><span class="normal"> signals</span><span class="symbol">[</span><span class="normal">CHANGED_SIGNAL</span><span class="symbol">],</span><span class="normal"> </span><span class="number">0</span><span class="symbol">);</span>
<span class="cbracket">}</span>

<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">accounts_user_g_properties_changed</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GDBusProxy</span><span class="normal">          </span><span class="symbol">*</span><span class="normal">proxy</span><span class="symbol">,</span>
<span class="normal">                                    </span><span class="usertype">GVariant</span><span class="normal">            </span><span class="symbol">*</span><span class="normal">changed_properties</span><span class="symbol">,</span>
<span class="normal">                                    </span><span class="keyword">const</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar">gchar</a></span><span class="symbol">*</span><span class="normal"> </span><span class="keyword">const</span><span class="normal">  </span><span class="symbol">*</span><span class="normal">invalidated_properties</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">AccountsUser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">user </span><span class="symbol">=</span><span class="normal"> </span><span class="function">ACCOUNTS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">proxy</span><span class="symbol">);</span>
<span class="normal">  </span><span class="usertype">GVariantIter</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">iter</span><span class="symbol">;</span>
<span class="normal">  </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">key</span><span class="symbol">;</span>

<span class="normal">  </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">changed_properties </span><span class="symbol">!=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span>
<span class="normal">    </span><span class="cbracket">{</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">changed_properties</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"a{sv}"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">iter</span><span class="symbol">);</span>
<span class="normal">      </span><span class="keyword">while</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-iter-next">g_variant_iter_next</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">iter</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"{&amp;sv}"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">key</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">))</span>
<span class="normal">        </span><span class="cbracket">{</span>
<span class="normal">          </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strcmp0">g_strcmp0</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">key</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"AutomaticLogin"</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> </span><span class="number">0</span><span class="symbol">)</span>
<span class="normal">            </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-notify">g_object_notify</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#G-OBJECT:CAPS">G_OBJECT</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"automatic-login"</span><span class="symbol">);</span>
<span class="normal">          </span><span class="keyword">else</span><span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strcmp0">g_strcmp0</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">key</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"RealName"</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> </span><span class="number">0</span><span class="symbol">)</span>
<span class="normal">            </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-notify">g_object_notify</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#G-OBJECT:CAPS">G_OBJECT</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"real-name"</span><span class="symbol">);</span>
<span class="normal">          </span><span class="keyword">else</span><span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strcmp0">g_strcmp0</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">key</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"UserName"</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> </span><span class="number">0</span><span class="symbol">)</span>
<span class="normal">            </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-notify">g_object_notify</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#G-OBJECT:CAPS">G_OBJECT</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"user-name"</span><span class="symbol">);</span>
<span class="normal">        </span><span class="cbracket">}</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-iter-free">g_variant_iter_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">iter</span><span class="symbol">);</span>
<span class="normal">    </span><span class="cbracket">}</span>
<span class="cbracket">}</span>

<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">accounts_user_class_init</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUserClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">klass</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">GObjectClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">gobject_class</span><span class="symbol">;</span>
<span class="normal">  </span><span class="usertype">GDBusProxyClass</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">proxy_class</span><span class="symbol">;</span>

<span class="normal">  gobject_class </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#G-OBJECT-CLASS:CAPS">G_OBJECT_CLASS</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">klass</span><span class="symbol">);</span>
<span class="normal">  gobject_class</span><span class="symbol">-&gt;</span><span class="normal">get_property </span><span class="symbol">=</span><span class="normal"> accounts_user_get_property</span><span class="symbol">;</span>
<span class="normal">  gobject_class</span><span class="symbol">-&gt;</span><span class="normal">finalize </span><span class="symbol">=</span><span class="normal"> accounts_user_finalize</span><span class="symbol">;</span>

<span class="normal">  proxy_class </span><span class="symbol">=</span><span class="normal"> </span><span class="function">G_DBUS_PROXY_CLASS</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">klass</span><span class="symbol">);</span>
<span class="normal">  proxy_class</span><span class="symbol">-&gt;</span><span class="normal">g_signal             </span><span class="symbol">=</span><span class="normal"> accounts_user_g_signal</span><span class="symbol">;</span>
<span class="normal">  proxy_class</span><span class="symbol">-&gt;</span><span class="normal">g_properties_changed </span><span class="symbol">=</span><span class="normal"> accounts_user_g_properties_changed</span><span class="symbol">;</span>

<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-class-install-property">g_object_class_install_property</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">gobject_class</span><span class="symbol">,</span>
<span class="normal">                                   PROP_USER_NAME</span><span class="symbol">,</span>
<span class="normal">                                   </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-string">g_param_spec_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"user-name"</span><span class="symbol">,</span>
<span class="normal">                                                        </span><span class="string">"User Name"</span><span class="symbol">,</span>
<span class="normal">                                                        </span><span class="string">"The user name of the user"</span><span class="symbol">,</span>
<span class="normal">                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span>
<span class="normal">                                                        <a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#G-PARAM-READABLE:CAPS">G_PARAM_READABLE</a> </span><span class="symbol">|</span>
<span class="normal">                                                        <a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#G-PARAM-STATIC-STRINGS:CAPS">G_PARAM_STATIC_STRINGS</a></span><span class="symbol">));</span>

<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-class-install-property">g_object_class_install_property</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">gobject_class</span><span class="symbol">,</span>
<span class="normal">                                   PROP_REAL_NAME</span><span class="symbol">,</span>
<span class="normal">                                   </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-string">g_param_spec_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"real-name"</span><span class="symbol">,</span>
<span class="normal">                                                        </span><span class="string">"Real Name"</span><span class="symbol">,</span>
<span class="normal">                                                        </span><span class="string">"The real name of the user"</span><span class="symbol">,</span>
<span class="normal">                                                        <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span>
<span class="normal">                                                        <a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#G-PARAM-READABLE:CAPS">G_PARAM_READABLE</a> </span><span class="symbol">|</span>
<span class="normal">                                                        <a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#G-PARAM-STATIC-STRINGS:CAPS">G_PARAM_STATIC_STRINGS</a></span><span class="symbol">));</span>

<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-class-install-property">g_object_class_install_property</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">gobject_class</span><span class="symbol">,</span>
<span class="normal">                                   PROP_AUTOMATIC_LOGIN</span><span class="symbol">,</span>
<span class="normal">                                   </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-boolean">g_param_spec_boolean</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"automatic-login"</span><span class="symbol">,</span>
<span class="normal">                                                         </span><span class="string">"Automatic Login"</span><span class="symbol">,</span>
<span class="normal">                                                         </span><span class="string">"Whether the user is automatically logged in"</span><span class="symbol">,</span>
<span class="normal">                                                         <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS">FALSE</a></span><span class="symbol">,</span>
<span class="normal">                                                         <a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#G-PARAM-READABLE:CAPS">G_PARAM_READABLE</a> </span><span class="symbol">|</span>
<span class="normal">                                                         <a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#G-PARAM-STATIC-STRINGS:CAPS">G_PARAM_STATIC_STRINGS</a></span><span class="symbol">));</span>

<span class="normal">  signals</span><span class="symbol">[</span><span class="normal">CHANGED_SIGNAL</span><span class="symbol">]</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-new">g_signal_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"changed"</span><span class="symbol">,</span>
<span class="normal">                                          ACCOUNTS_TYPE_USER</span><span class="symbol">,</span>
<span class="normal">                                          <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">G_SIGNAL_RUN_LAST</a></span><span class="symbol">,</span>
<span class="normal">                                          </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#G-STRUCT-OFFSET:CAPS">G_STRUCT_OFFSET</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">AccountsUserClass</span><span class="symbol">,</span><span class="normal"> <a href="/usr/share/gtk-doc/html/UPower/UPower-up-device.html#changed">changed</a></span><span class="symbol">),</span>
<span class="normal">                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span>
<span class="normal">                                          <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span>
<span class="normal">                                          <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#g-cclosure-marshal-VOID--VOID">g_cclosure_marshal_VOID__VOID</a></span><span class="symbol">,</span>
<span class="normal">                                          <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS">G_TYPE_NONE</a></span><span class="symbol">,</span>
<span class="normal">                                          </span><span class="number">0</span><span class="symbol">);</span>
<span class="cbracket">}</span>

<span class="normal"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar">gchar</a> </span><span class="symbol">*</span>
<span class="function">accounts_user_frobnicate_sync</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">,</span>
<span class="normal">                               </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal">         </span><span class="symbol">*</span><span class="normal">flux</span><span class="symbol">,</span>
<span class="normal">                               </span><span class="usertype">gint</span><span class="normal">                 baz</span><span class="symbol">,</span>
<span class="normal">                               </span><span class="usertype">GCancellable</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">cancellable</span><span class="symbol">,</span>
<span class="normal">                               </span><span class="usertype">GError</span><span class="normal">             </span><span class="symbol">**</span><span class="normal">error</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">ret</span><span class="symbol">;</span>
<span class="normal">  </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>

<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">ACCOUNTS_IS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>

<span class="normal">  ret </span><span class="symbol">=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>

<span class="normal">  value </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDBusProxy.html#g-dbus-proxy-call-sync">g_dbus_proxy_call_sync</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">G_DBUS_PROXY</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span>
<span class="normal">                                  </span><span class="string">"Frobnicate"</span><span class="symbol">,</span>
<span class="normal">                                  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"(si)"</span><span class="symbol">,</span>
<span class="normal">                                                 flux</span><span class="symbol">,</span>
<span class="normal">                                                 baz</span><span class="symbol">),</span>
<span class="normal">                                  <a href="GDBusConnection.html#G-DBUS-CALL-FLAGS-NONE:CAPS">G_DBUS_CALL_FLAGS_NONE</a></span><span class="symbol">,</span>
<span class="normal">                                  </span><span class="symbol">-</span><span class="number">1</span><span class="symbol">,</span>
<span class="normal">                                  cancellable</span><span class="symbol">,</span>
<span class="normal">                                  error</span><span class="symbol">);</span>
<span class="normal">  </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value </span><span class="symbol">!=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span>
<span class="normal">    </span><span class="cbracket">{</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"(s)"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">ret</span><span class="symbol">);</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-unref">g_variant_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span>
<span class="normal">    </span><span class="cbracket">}</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> ret</span><span class="symbol">;</span>
<span class="cbracket">}</span>

<span class="type">void</span>
<span class="function">accounts_user_frobnicate</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">,</span>
<span class="normal">                          </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal">         </span><span class="symbol">*</span><span class="normal">flux</span><span class="symbol">,</span>
<span class="normal">                          </span><span class="usertype">gint</span><span class="normal">                 baz</span><span class="symbol">,</span>
<span class="normal">                          </span><span class="usertype">GCancellable</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">cancellable</span><span class="symbol">,</span>
<span class="normal">                          </span><span class="usertype">GAsyncReadyCallback</span><span class="normal">  callback</span><span class="symbol">,</span>
<span class="normal">                          </span><span class="usertype">gpointer</span><span class="normal">             user_data</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-if-fail">g_return_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">ACCOUNTS_IS_USER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">));</span>
<span class="normal">  </span><span class="function"><a href="GDBusProxy.html#g-dbus-proxy-call">g_dbus_proxy_call</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">G_DBUS_PROXY</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span>
<span class="normal">                     </span><span class="string">"Frobnicate"</span><span class="symbol">,</span>
<span class="normal">                     </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"(si)"</span><span class="symbol">,</span>
<span class="normal">                                    flux</span><span class="symbol">,</span>
<span class="normal">                                    baz</span><span class="symbol">),</span>
<span class="normal">                     <a href="GDBusConnection.html#G-DBUS-CALL-FLAGS-NONE:CAPS">G_DBUS_CALL_FLAGS_NONE</a></span><span class="symbol">,</span>
<span class="normal">                     </span><span class="symbol">-</span><span class="number">1</span><span class="symbol">,</span>
<span class="normal">                     cancellable</span><span class="symbol">,</span>
<span class="normal">                     callback</span><span class="symbol">,</span>
<span class="normal">                     user_data</span><span class="symbol">);</span>
<span class="cbracket">}</span>


<span class="normal"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar">gchar</a> </span><span class="symbol">*</span>
<span class="function">accounts_user_frobnicate_finish</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">AccountsUser</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">user</span><span class="symbol">,</span>
<span class="normal">                                 </span><span class="usertype">GAsyncResult</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">res</span><span class="symbol">,</span>
<span class="normal">                                 </span><span class="usertype">GError</span><span class="normal">             </span><span class="symbol">**</span><span class="normal">error</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">ret</span><span class="symbol">;</span>
<span class="normal">  </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>

<span class="normal">  ret </span><span class="symbol">=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
<span class="normal">  value </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDBusProxy.html#g-dbus-proxy-call-finish">g_dbus_proxy_call_finish</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">G_DBUS_PROXY</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user</span><span class="symbol">),</span><span class="normal"> res</span><span class="symbol">,</span><span class="normal"> error</span><span class="symbol">);</span>
<span class="normal">  </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value </span><span class="symbol">!=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span>
<span class="normal">    </span><span class="cbracket">{</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"(s)"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">ret</span><span class="symbol">);</span>
<span class="normal">      </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-unref">g_variant_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span>
<span class="normal">    </span><span class="cbracket">}</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> ret</span><span class="symbol">;</span>
<span class="cbracket">}</span>

<span class="comment">/* ---------------------------------------------------------------------------------------------------- */</span>

<span class="normal"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint">gint</a></span>
<span class="function">main</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">gint</span><span class="normal"> argc</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">argv</span><span class="symbol">[])</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<br class="example-break">
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>